#include <limits.h>
#include <string.h>

#define MAXSTRINGSZ 4096

static char envbuf[MAXSTRINGSZ];

extern char **envron;

char * getenv(const char *name) {
    int i, len;
    len= strlen(name);
    for (i=0; envron[i] != NULL; i++) {
        if (strncmp(name, envron[i], len) == 0 && envron[i][len] == '=') {
            strncpy(envbuf, envron[i]+len, MAXSTRINGSZ - 1);
            return(envbuf);
        }
    }
    return NULL;
}
